home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Information / AD Programmer Package / Programming Examples / Generic in Pascal / Sounds.p < prev   
Text File  |  1991-06-03  |  2KB  |  60 lines

  1. {}
  2. {    Sounds.p}
  3. {}
  4. {    A module to provide simple sound playing for After Dark modules.}
  5. {    }
  6. {    by Patrick C. Beard.}
  7. {    }
  8. {    7/5/90 - One shot sound, returning handle to a structure that keeps information}
  9. {    about the operating sound manager.}
  10. {    }
  11. {    3/20/91 - Sound under A/UX 2.0.1 is not as we thought.  It is based on}
  12. {    system 6.0.7, and yet the sound manager doesn't support multiple channels of}
  13. {    sound.  Nuts.  Need to use Gestalt to check for the sound input/output manager}
  14. {    instead of testing the system version.}
  15. {    }
  16. {    3/28/91 - Modifying interfaces to use call backs provided by After Dark.  Requires}
  17. {    addition of GMParams}
  18. {    }
  19. {    Copyright © 1990, 1991 Berkeley Systems, Inc.}
  20. { }
  21.  
  22. unit Sounds;
  23.  
  24. interface
  25.  
  26.     uses
  27.         Sound, GraphicsModuleTypes;
  28.  
  29.     type
  30.         SoundInfo = record
  31.                 privateData: longint;
  32.                 hasSoundIOManager: Boolean;
  33.             end;
  34.  
  35.         SoundInfoPtr = ^SoundInfo;
  36.         SoundInfoHandle = ^SoundInfoPtr;
  37.  
  38.     function OpenSound (params: GMParamBlockPtr): SoundInfoHandle;
  39.     procedure CloseSound (info: SoundInfoHandle; channel: SndChannelPtr);
  40.     procedure PlaySound (info: SoundInfoHandle; channel: SndChannelPtr; sound: Handle);
  41.     procedure QuietSound (info: SoundInfoHandle; channel: SndChannelPtr);
  42.     procedure FlushSound (info: SoundInfoHandle; channel: SndChannelPtr);
  43.     function GetSoundLength (info: SoundInfoHandle; sound: Handle): longint;
  44.  
  45. implementation
  46.  
  47.     function OpenSound (params: GMParamBlockPtr): SoundInfoHandle;
  48.     external;
  49.     procedure CloseSound (info: SoundInfoHandle; channel: SndChannelPtr);
  50.     external;
  51.     procedure PlaySound (info: SoundInfoHandle; channel: SndChannelPtr; sound: Handle);
  52.     external;
  53.     procedure QuietSound (info: SoundInfoHandle; channel: SndChannelPtr);
  54.     external;
  55.     procedure FlushSound (info: SoundInfoHandle; channel: SndChannelPtr);
  56.     external;
  57.     function GetSoundLength (info: SoundInfoHandle; sound: Handle): longint;
  58.     external;
  59.  
  60. end.